/*
 * Copyright 2002-2006 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language governing permissions and limitations under the
 * License.
 */
package pikes.samples.countries.ui.peak;

import pikes.peak.Composite;
import pikes.peak.Label;
import pikes.peak.LabelStyle;
import pikes.peak.Paragraph;
import pikes.peak.TextGroupStyle;

public class ConfigPage extends BehaviourPage {

	@Override
	protected String getTitle() {
		return "config.htitle";
	}

	@Override
	protected void buildContent(Composite content) {
		Label strongCopy = new Label("copy", LabelStyle.STRONG);
		Label countriesServlet = new Label("countries-servlet.xml", LabelStyle.STRONG);
		Label applicationContext = new Label("applicationContext.xml", LabelStyle.STRONG);
		Label onlyMemoryOrOnlyDB = new Label("ONLY MEMORY OR ONLY DATABASE IMPLEMENTATION", LabelStyle.STRONG);
		Label memoryPlusDB = new Label("MEMORY+DATABASE IMPLEMENTATION FOR COPYING FROM MEMORY TO DATABASE",
				LabelStyle.STRONG);
		Label inMemoryOnly = new Label("In memory only version", LabelStyle.STRONG);
		Label memoryPlusDBForCopy = new Label("In memory + Database version for copying", LabelStyle.STRONG);

		content.add(new Paragraph("config.title", TextGroupStyle.LEVEL_2));
		content.add(Label.LINE_BREAK);
		content.add(new Paragraph("config.intro"));
		content.add(new Paragraph("config.presentation.title", TextGroupStyle.LEVEL_3));

		Paragraph configSimpleTitle = new Paragraph("1. ", TextGroupStyle.LEVEL_4);
		configSimpleTitle.add("config.simple.title");
		content.add(configSimpleTitle);

		content.add(new Paragraph("config.presentation.simple.sentence1"));
		content.add(new Paragraph("config.presentation.simple.sentence2"));
		content.add(new Paragraph("config.presentation.simple.sentence3"));

		Paragraph configCopyTitle = new Paragraph("2. ", TextGroupStyle.LEVEL_4);
		configCopyTitle.add("config.copy.title");
		content.add(configCopyTitle);

		content.add(new Paragraph("config.presentation.copy.sentence1"));
		content.add(new Paragraph("config.presentation.copy.sentence2"));

		Paragraph presCopy3 = new Paragraph("config.presentation.copy.sentence3");
		presCopy3.add(strongCopy);
		presCopy3.add("config.presentation.copy.sentence4");
		content.add(presCopy3);

		Paragraph configDBTitle = new Paragraph("3. ", TextGroupStyle.LEVEL_4);
		configDBTitle.add("config.database.title");
		content.add(configDBTitle);

		content.add(new Paragraph("config.presentation.database.sentence1"));
		Paragraph presDB2 = new Paragraph("config.presentation.database.sentence2");
		presDB2.add(strongCopy);
		presDB2.add("config.presentation.database.sentence3");
		content.add(presDB2);

		content.add(Label.LINE_BREAK);

		content.add(new Paragraph("config.technic.title", TextGroupStyle.LEVEL_3));

		content.add(configSimpleTitle);

		content.add(new Paragraph("config.technic.simple.sentence1"));

		content.add(configCopyTitle);

		Paragraph confTechIn = new Paragraph("config.technic.in");
		confTechIn.add(countriesServlet);
		confTechIn.add("config.technic.commenton");
		confTechIn.add(onlyMemoryOrOnlyDB);
		confTechIn.add("config.technic.uncommenton");
		confTechIn.add(memoryPlusDB);
		confTechIn.add(".");
		content.add(confTechIn);

		Paragraph acti = new Paragraph("config.technic.in");
		acti.add(applicationContext);
		acti.add("config.technic.commenton");
		acti.add(inMemoryOnly);
		acti.add("config.technic.uncommenton");
		acti.add(memoryPlusDBForCopy);
		acti.add(".");
		content.add(acti);

		content.add(configDBTitle);

		Paragraph par7 = new Paragraph("config.technic.in");
		par7.add(countriesServlet);
		par7.add("config.technic.commenton");
		par7.add(memoryPlusDB);
		par7.add("config.technic.uncommenton");
		par7.add(onlyMemoryOrOnlyDB);
		par7.add(". ");
		par7.add("config.technic.youreturned");
		content.add(par7);

		Paragraph par8 = new Paragraph("config.technic.in");
		par8.add(applicationContext);
		par8.add("config.technic.commenton");
		par8.add(memoryPlusDBForCopy);
		par8.add("config.technic.uncommenton");
		par8.add(new Label("Database only version", LabelStyle.STRONG));
		par8.add(".");
		content.add(par8);
	}

}
